<style>
    .ng-invalid+.sp{
        display: inline;
        color: red;
    }
    .sp{
        display: none;
    }
</style>
<div>
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">邮件
            <div class="pull-right">
                <a  class="btn btn-sm btn-default" onclick="history.go(-1)">返回列表</a>
            </div>
        </h1>
    </div>
    <div class="padder-md m-b-none m-t" style="padding-top: 0">
        <div class="panel panel-default">
            <div class="modal-header">
                <h3 class="modal-title">修改邮件</h3>
            </div>
            <div class="modal-body">
                <div class="row" style="padding: 1% 0">
                    <div class=" " style="padding-bottom: 10px;width: 100%">
                        <div class="col-sm-2 text-right" style="padding-top: 5px;">名称：</div>
                        <div class="col-sm-8">
                            <input class="form-control" ng-model="ctrl.vm.data.name" type="text" placeholder="请在这里输入名称" required>
                        </div>
                    </div>
                </div>
                <div class="row" style="padding: 1% 0">
                    <div class=" " style="padding-bottom: 10px;width: 100%">
                        <div class="col-sm-2 text-right" style="padding-top: 5px;">编码：</div>
                        <div class="col-sm-8">
                            <input class="form-control" ng-pattern="/^[a-z\_]+$/" ng-model="ctrl.vm.data.code" type="text" placeholder="请在这里输入编码" required>
                            <span class="sp">只能输入英文小写字母和下划线</span>
                        </div>
                    </div>
                </div>
                <div class="row" style="padding: 1% 0">
                    <div class=" " style="padding-bottom: 10px;width: 100%">
                        <div class="col-sm-2 text-right" style="padding-top: 5px;">邮件说明：</div>
                        <div class="col-sm-8">
                            <input class="form-control" ng-model="ctrl.vm.data.info" type="text" placeholder="请在这里输入邮件说明" required>
                        </div>
                    </div>
                </div>
                <div class="row" style="padding: 1% 0">
                    <div class=" " style="padding-bottom: 10px;width: 100%">
                        <div class="col-sm-2 text-right" style="padding-top: 5px;">邮件内容：</div>
                        <div class="col-sm-8">
                            <textarea ng-model="ctrl.vm.data.content" class="form-control" style="width: 100%;height: 400px"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-sm btn-success" ng-click="ctrl.vm.up(ctrl.vm.data.id)">保存</button>
            </div>
        </div>
    </div>
</div>